<template>
  <div class="page">
    <div class="header-tab-box">
      <div @click="selectedTab=1">
        <span :class="{active : selectedTab==1}">日报表</span>
      </div>
      <div @click="selectedTab=2">
        <span :class="{active : selectedTab==2}">月报表</span>
      </div>
      <div @click="selectedTab=3">
        <span :class="{active : selectedTab==3}">年报表</span>
      </div>
    </div>
    <couponDayReport v-show="selectedTab==1"></couponDayReport>
    <couponMonthReport v-show="selectedTab==2"></couponMonthReport>
    <couponYearReport v-show="selectedTab==3"></couponYearReport>
  </div>
</template>

<script>
import couponDayReport from './couponDayReport'
import couponMonthReport from './couponMonthReport'
import couponYearReport from './couponYearReport'
  export default {
    components:{
      couponDayReport,
      couponMonthReport,
      couponYearReport
    },
    data(){
      return{
        title:'券报表',
        selectedTab: 1, //被选择的tab(1:日报; 2:月报; 3:年报)
      }
    },
    created(){
      this.$store.commit('setTitle',this.title)
      this.$store.commit('setShowCloseBtn',false)
    },
  }
</script>

<style lang="less">
.header-tab-box{
  background: #ffffff;
  height: 100px;
  display: flex;
  margin-bottom: 20px;
  > div{
    flex: 1;
    padding: 0 50px;
    > span{
      display: block;
      height: 100px;
      line-height: 100px;
      font-size: 28px;
      color: #696969;
      text-align: center;
      &.active{
        border-bottom: 5px solid @blue;
        color: #1875ED;
      }
    }
  }
}
</style>
